import vapoursynth as vs
core = vs.get_core()
import os
core.std.LoadPlugin(path=r"D:\Software\MyDCPConverterHQ - kopie\Bin\vsimagereader.dll")
core.std.LoadPlugin(path=r"D:\Software\MyDCPConverterHQ - kopie\Bin\fmtconv.dll")
ext = 'L.png'
dir = r"D:\TEMP\IMAGESEQUENCE FOLDER"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vl1 = core.imgr.Read(srcs)
vl1 = core.fmtc.matrix(vl1, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=0)
vl = vl1
vl = core.std.CropRel(vl, left=0, right=0, top=0, bottom=0)
new_height = round(vl.height / vl.width * 1920 / 2) * 2
vl = core.resize.Lanczos(vl, width=1920, height=new_height)
border_height = round((1080 - vl.height) / 2)
vl = core.std.AddBorders(vl, top=border_height, bottom=border_height, color=[0,32768,32768])
ext = 'R.png'
dir = r"D:\TEMP\IMAGESEQUENCE FOLDER"
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
vr1 = core.imgr.Read(srcs)
vr1 = core.fmtc.matrix(vr1, mat="709", col_fam=vs.YUV, csp=vs.YUV444P16, bits=16, fulls=1, fulld=0)
vr = vr1
vr = core.std.CropRel(vr, left=0, right=0, top=0, bottom=0)
vr = core.resize.Lanczos(vr, width=1920, height=new_height)
border_height = round((1080 - vr.height) / 2)
vr = core.std.AddBorders(vr, top=border_height, bottom=border_height, color=[0,32768,32768])
v = core.std.StackHorizontal([vl,vr])
v = core.std.AssumeFPS(v, fpsnum=24)
v = core.fmtc.resample(v, css="420")
v = core.fmtc.bitdepth(v, bits=8, dmode=3)
v.set_output()
